package cn.cloudtogo.server.mysql.controller;

import cn.cloudtogo.common.types.Result;
import cn.cloudtogo.support.mysql.column.Types;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

import static cn.cloudtogo.server.WebResponse.ok;

/**
 * @author yaolianhua789@gmail.com
 **/
@RestController
@RequestMapping("/columntypes")
public class TypesController {

    @GetMapping
    public ResponseEntity<Result<List<Types.ColumnType>>> columntypes() {
        return ok(Arrays.asList(Types.ColumnType.values()));
    }

}
